#ifndef _QIMPEN_MATCH_H
#define _QIMPEN_MATCH_H

#include <qlist.h>

class QTimer;
class QIMPenWidget;

class QIMPenMatch : public QObject
{
    Q_OBJECT
public:
    QIMPenMatch( QObject *parent=0, const char *name=0 );
    virtual ~QIMPenMatch();

public slots:
    void beginStroke();
    //void strokeEntered( QIMPenStrokeList *strokes );

protected:
    QTimer *multiTimer;
    int multiTimeout;

    QRect rectBound;
    double scoreMatrix[MAX_CHARACTER_SUB_STROKE_COUNT + 1][MAX_CHARACTER_SUB_STROKE_COUNT + 1];
    double directions[MAX_CHARACTER_SUB_STROKE_COUNT];
    double lengths[MAX_CHARACTER_SUB_STROKE_COUNT];
    int subStrokeCount;
    int strokeCount;

    void initScoreMatrix();
    void addStroke( QIMPenStroke *stroke );
    void strokeAnalyze(QIMPenStroke *stroke);
    void newMatch();
};
#endif
